package cate.common.table.farm.forbidden.row.fm;

import cate.common.table.ERow;
import cate.common.table.XSSFRowWrap;
import cate.common.table.farm.FightChallenge;
import cate.common.table.farm.OperOption;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;

import java.util.List;

@NoteClass(value = "混沌之地挑战要求")
public class FMConditionRow extends ERow implements FightChallenge {

    @NoteField(value = "挑战ID")
    public int tid;

    @NoteField(value = "挑战类型")
    public int type;

    @NoteField(value = "挑战参数")
    private String paramStr;

    @NoteField(value = "检测操作")
    private String checkOper;

    @NoteField(value = "目标值")
    private String value;

    @Override
    public void parse(XSSFRowWrap xrw) {
        super.parse(xrw);
        this.id = xrw.getInteger("ID", -1);
        this.tid = this.id;
        this.type = xrw.getInteger("挑战类型");
        this.paramStr = xrw.getString("挑战参数");
        this.checkOper = xrw.getString("检测操作");
        this.value = xrw.getString("目标值");
    }

    List<OperOption> options;

    @Override
    public void decode() {
        options = createOperOption(paramStr, checkOper, value);
    }

    @Override
    public int getType() {
        return this.type;
    }

    @Override
    public List<OperOption> getOperOptions() {
        return options;
    }

    @Override
    public int getHeroProto() {
        return 0;
    }


}
